<HTML>
<HEAD>
<TITLE>Getting started - Methanol+Water</TITLE>
<LINK rel=stylesheet href="style.css" type="text/css">
<BODY text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#990000" alink="#FF0000">
<TABLE WIDTH="98%" NOBORDER >
<TR><TD WIDTH=400>
<TABLE WIDTH=400 NOBORDER>
<TD WIDTH=116>
<a href="http://www.gromacs.org/"><img SRC="../images/gmxlogo_small.jpg"BORDER=0 height=133 width=116></a></td>
<td ALIGN=LEFT VALIGN=TOP WIDTH=280><br><h2>Getting started - Methanol+Water</h2>
<font size=-1><A HREF="../online.html">Main Table of Contents</A></font><br><br></td>
</TABLE></TD><TD WIDTH="*" ALIGN=RIGHT VALIGN=BOTTOM><p><B>VERSION 4.0<br>
Sun 18 Jan 2009</B></td></tr></TABLE>
<HR>

<P><H2>Methanol+Water</A></H2>

Now you are going to simulate 216 molecules of methanol and 216
molecules of water in a rectangular box (of 4.72 x 2.36 x 2.36 nm). 
The molecules are completely demixed in the start conformation.

<P>
Change your directory to <tt>tutor/mixed </tt>:   
<br><br>
<table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
<tr NOSAVE>
<td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
<td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">

<tt> cd tutor/mixed</tt>
<td></td>
</tr>
</table>
<br>

Start by viewing the simulation box graphically:
<br><br>
<table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
<tr NOSAVE>
<td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
<td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">

<tt>  rasmol mixed.pdb
</tt>
<td></td>
</tr>
</table>
<br>
Note that one side of the box only contains methanol while the other only
contains water.
</p>

<p>
Since all the neccesary files are available, we are going to,
preprocess all the input files to create a run input 
(<TT><a href="tpr.html">.tpr</a></TT>) file. 
This run input file is the only input file for the
MD-program <TT><a href="mdrun.html">mdrun</a></TT>. 
<br><br>
<table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
<tr NOSAVE>
<td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
<td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">

<tt>  grompp -v
</tt>
<td></td>
</tr>
</table>
<br>

Now it's time to start the simulation of 1000 picoseconds. Since this will 
take some time, it has to be started in the background, otherwise you will
not be able to log out without terminating the simulation. 
<br><br>
<table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
<tr NOSAVE>
<td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
<td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">

<tt> nohup mdrun -v >& log &
</tt>
<td></td>
</tr>
</table>
<br>

After the MD simulation is finished (but even while it is still running), 
it is possible to view the
trajectory with the <a href="ngmx.html">ngmx</a> program:
<br><br>
<table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
<tr NOSAVE>
<td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
<td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">

<tt> ngmx
</tt>
<td></td>
</tr>
</table>
<br>

<P>
When the program starts, you must select a group of atoms to view. 
You can choose to select only one group, or both. If you select first methanol
and then rewind the trajectory and select water, you see how the mixing takes 
place.
</P>

<hr>
<h2>Analysis of the simulation</h2>
<ol>
<li><p>First we will analyze the mixing process. We can compute the density
of molecules, along the long axis of the simulation box, at different
times in the simulation.
<br><br>
<table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
<tr NOSAVE>
<td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
<td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">

<tt> g_density -n index -o dens0 -b 0 -e 50 -d X
</tt>
<td></td>
</tr>
</table>
<br>
Here the <TT>-b</TT> and <TT>-e</TT> options indicate begin and end of the
analysis. When asked which groups to analyse you select two groups,
MeOH and Water. Now do the same for four more stretches of 50 ps along the 
1000 ps trajectory (remember to change the name of the output file as well),
e.g. with begin times 0, 240, 480, 720, 950). And view all the output files
at once (if you used different names, replace the ones below with those):
<br><br>
<table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
<tr NOSAVE>
<td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
<td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">

<tt> xmgrace -nxy dens0.xvg  -nxy dens240.xvg  -nxy dens480.xvg  -nxy dens720.xvg  -nxy dens950.xvg -legend load
</tt>
<td></td>
</tr>
</table>
<br>
<font color="red">Explain the results. When (at which timepoint)
do you consider the system  completely mixed?</font>

</p>
</li>
<li><p> Calculate a radial distribution function of the oxygen atoms
around oxygen atoms. The index file <TT><a
href="ndx.html">index.ndx</a></TT> now contains multiple groups.
Select oxygen (containing both the water oxygen and the methanol oxygen).
<br><br>
<table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
<tr NOSAVE>
<td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
<td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">

<tt> g_rdf -n index -o rdf-oo.xvg -b 900
</tt>
<td></td>
</tr>
</table>
<br>
The program will ask you for how many groups you want the calculate
the RDF, answer 1 (and select oxygen and oxygen). We start at 900 ps
in order to only use the completely mixed system.
Now, view the output graph.
<br><br>
<table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
<tr NOSAVE>
<td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
<td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">

<tt> xmgrace rdf-oo.xvg 
</tt>
<td></td>
</tr>
</table>
<br>
Which shows you the radial distribution function for oxygen-oxygen in the 
mixture. Now do the same thing using the methyl group as reference and
as target (and use e.g. <tt>rdf-mm.xvg</tt> as output file name). Do not 
forget the <TT>-b 900</TT> option to <TT>g_rdf</tt>. View all
the graphs together:
<br><br>
<table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
<tr NOSAVE>
<td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
<td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">

<tt> xmgrace rdf-oo.xvg ../methanol/rdf-oo.xvg ../water/rdf.xvg -legend load
</tt>
<td></td>
</tr>
</table>
<br>
The <tt>xmgrace</tt> program will display three different graphs.
<font color="red">Compare the resulting graphs. Explain the differences and the
similarities.</font><br>

Do the same analysis for the Me-Me RDF in the mixture and in pure methanol.
<font color="red">Compare the resulting graphs. Explain the differences and the
similarities.</font>
</P></li>

<li><p>
We can also do a direct analysis of the number of hydrogen bonds in
methanol, based on O-O distance and O-H ... O angle.
<br><br>
<table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
<tr NOSAVE>
<td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
<td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">

<tt> g_hbond
</tt>
<td></td>
</tr>
</table>
<br>
Select twice 0, when asked. Check the output with 
<br><br>
<table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
<tr NOSAVE>
<td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
<td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">

<tt> xmgrace hbnum.xvg 
</tt>
<td></td>
</tr>
</table>
<br>
<font color="red">What is the number of hydrogen bonds per 
molecule? Compare the results to
those from pure water and from pure methanol. Does the total 
number of hydrogen bonds change during the mixing process?</font>
</p></li>

<li><p> As a further test of the simulation we will compute the self
diffusion constant of Methanol and water in the mixed state.
<br><br>
<table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
<tr NOSAVE>
<td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
<td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">

<tt> g_msd -n index -b 900
</tt>
<td></td>
</tr>
</table>
<br>
(Run it twice, first selecting Me1 and then OW). View the output
<br><br>
<table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
<tr NOSAVE>
<td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
<td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">

<tt> xmgrace msd.xvg 
</tt>
<td></td>
</tr>
</table>
<br>
Check that the graph is roughly linear. The <tt>g_msd</tt> program also
computes the diffusion constant D for you. 
<font color="red">Compare the result to pure water and pure methanol. 
Is it as you would expect?
</font>
</p></li>
</ol>

<hr>
<a href="speptide.html"><H3>Go to the next step</h3></a>
<hr>

</BODY>
</HTML>
